package com.flexcodejam.vfd.command {

	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.adobe.cairngorm.control.CairngormEventDispatcher;	
	
	import com.flexcodejam.vfd.business.*;
	import com.flexcodejam.vfd.control.*;
	import com.flexcodejam.vfd.event.*;	
	import com.flexcodejam.vfd.model.*;
	import com.flexcodejam.vfd.vo.*;			
	
	import mx.rpc.IResponder;
	import mx.rpc.events.*;
	import mx.controls.Alert;
	import mx.utils.ObjectUtil;
	import flash.events.Event;


	public class GetFoodDriveCommandById implements ICommand, IResponder
	{
		private var model:VFDModelLocator = VFDModelLocator.getInstance();

		public function GetFoodDriveCommandById():void
		{
			// constructor...
		}	

		public function execute(event:CairngormEvent):void
		{							
			// todo: change the state of the login form to show 'pending'
				
			var delegate:FoodDriveDelegate = new FoodDriveDelegate(this);					
			var foodDriveEvent:FoodDriveEvent = event as FoodDriveEvent;
					
					
			//delegate.GetFoodDriveById(foodDriveEvent.foodDrive);			
		
			 
		}
		
		
		public function result(event:Object):void
		{
			// event.result ... what did we get back?
			 

		}
		
			public function fault(event:Object):void
		{
			// display the error message to the user 
			Alert.show(ObjectUtil.toString(event.toString()).substring(1,600), "Error");
		}

	}

 	
}	
	
